//
//  PlayGameController.h
//  Quiz
//
//  Created by AnhLH-Oriolus on 28/07/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ViewSelect.h"
#import "FMDatabase.h"
#import "FontLabel.h"

@interface PlayGameController : UIViewController {
	UILabel *lblQuestionIndex;
	UILabel *lblScore;
	
	UILabel *lblClue;
	UILabel *lblTime;
	UILabel *lblTimeCountDown;
	
	UIButton *btnAnswerA;
	UIButton *btnAnswerB;
	UIButton *btnAnswerC;
	UIButton *btnAnswerD;
	
	ViewSelect *viewSelectA;
	ViewSelect *viewSelectB;
	ViewSelect *viewSelectC;
	ViewSelect *viewSelectD;
	
	float fTimeTick; // dung de tinh diem khi clik
	float fCurrTick;
	
	int iCurrPoint;
	int iScore;
	NSTimer *timer;
	UIProgressView* progressView;//time decrease
	
	
	FMDatabase* db;
	int iTotalQuestion;
	int iCurrQuestion;
	NSMutableArray *arrQuestion; //luu 7 phan tu: id cau tra loi, text tra loi, 5 clue
	NSMutableArray *arrIdUsed;//mang chua id da dc su dung de lam cau hoi
	NSMutableArray *arrOtherOptions; // mang chua 3 option khac cau tra loi
	
	NSString *playerName;
}

-(void)initComponentQuiz;
-(void)initTimer;
-(void)checkAnswer;

-(BOOL)openDb;
-(void)closeDb;
-(void)resetAllData;
-(void)renegateQuestion;
-(void)getTotalNumberQuestion;
-(void)endGame;
-(void)disPlayQuestion;

-(void)setPlayerName:(NSString *)name;

-(void)updateOwnScore;
@end
